﻿@page "/"
@inherits PageBase

<PageContainer>
    <Breadcrumb>
        <Breadcrumb>
            <BreadcrumbItem><Icon Type="home"></Icon></BreadcrumbItem>
            <BreadcrumbItem><Icon Type="dashboard"></Icon><span>Dashboard</span></BreadcrumbItem>
        </Breadcrumb>
    </Breadcrumb>
    <ChildContent>
        <Card Bordered="false">
            <Row Gutter="16">
                <AntDesign.Col Span="8">
                    <Card>
                        <Statistic Title="文章" Value="@statistics.Item1" Suffix="篇">
                            <PrefixTemplate>
                                <span><Icon Type="read" /></span>
                            </PrefixTemplate>
                        </Statistic>
                    </Card>
                </AntDesign.Col>
                <AntDesign.Col Span="8">
                    <Card>
                        <Statistic Title="分类" Value="@statistics.Item2" Suffix="个">
                            <PrefixTemplate>
                                <span><Icon Type="switcher" /></span>
                            </PrefixTemplate>
                        </Statistic>
                    </Card>
                </AntDesign.Col>
                <AntDesign.Col Span="8">
                    <Card>
                        <Statistic Title="标签" Value="@statistics.Item3" Suffix="个">
                            <PrefixTemplate>
                                <span><Icon Type="tags" /></span>
                            </PrefixTemplate>
                        </Statistic>
                    </Card>
                </AntDesign.Col>
            </Row>
        </Card>
        <Card Bordered="false">
            <Table TItem="NameValue" DataSource="@data" Loading="isLoading" Bordered=@true HidePagination="true" Size=@TableSize.Small>
                <Column @bind-Field="@context.Name" Title="服务名称" Sortable="false">
                    <Text Strong="true">@context.Name</Text>
                </Column>
                <Column @bind-Field="@context.Value" Title="健康状态" Sortable="false" HeaderColSpan="2"></Column>
                <Column @bind-Field="@context.Value" HeaderColSpan="0">
                    <Badge Status="@(context.Value == "Healthy" ? "processing" : "error")" />
                </Column>
            </Table>
        </Card>
    </ChildContent>
</PageContainer>